package com.yc.resfoods.configs;

import com.alibaba.csp.sentinel.adapter.spring.webmvc.callback.RequestOriginParser;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import javax.servlet.http.HttpServletRequest;

/**
 * @ClassName CustomerRequestOringinParser
 * @since: 2023/8/26 10:34
 * @auth: kirito
 * @description:
 **/
@Component
@Slf4j
public class CustomerRequestOriginParser implements RequestOriginParser {
    @Override
    public String parseOrigin(HttpServletRequest httpServletRequest) {
        log.info("解析请求头中的origin");
        String source = httpServletRequest.getHeader("source");
        log.info("请求来源：" + source);
        return source;
    }
}
